<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<% String path=request.getContextPath(); String basePath=request.getScheme()+ "://"+request.getServerName()+ ":"+request.getServerPort()+path+ "/"; %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>    
      <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />
        <title>微信商城</title>
        
        <link href="css/style.css" rel="stylesheet">
        <link rel="stylesheet" type="text/css" href="touchTouch/touchTouch.css">
        <link rel="stylesheet" href="css/pintuer.css">
        <script type="text/javascript" src="js/jquery.min.js"></script>
        <script src="js/script.js"></script>
        <script src="js/jquery.js"></script>

        <script src="touchTouch/touchTouch.jquery.js"></script>
        

      </head>
      
      <body>
        <section>
          <banner>

            <yiny></yiny>
          </banner>
          <div class="jindutiao">

          <div class="centerq">

            <div class="canyu">
            <br/>
                   <h1></h1>
                             <br/>
                          <h1></h1>
              <p id="btn-m">购买</p>
            </div>
          </div>
          </div>
        </section>
      </body>
      

      
      <script type="text/javascript">
      //点击购买按钮调用方法
      $("#btn-m").click(function() {

            var openId = '<%=request.getParameter("openId")%>';

            var num = 1;
            var money = num*1 ;

             
                  //调用支付接口
                  $.ajax({
                    url:"http://cb.by-edu.com/topayServlet?openId="+openId+"&money="+money,
                    type: "get",
                    dataType: "json",
                    success: function(json) {

                      WeixinJSBridge.invoke('getBrandWCPayRequest', {
                        "appId": json.appId,
                        "timeStamp": json.timeStamp,
                        "nonceStr": json.nonceStr,
                        "package": json.packages,
                        "signType": "MD5",
                        "paySign": json.sign
                      },
                      //调起微信支付成功
                      function(res) {
                        if (res.err_msg == "get_brand_wcpay_request:ok") {
                          //返回商品中心


                        } else {

   
                 
                        }
                      });
                    },
  
                    error:function(){
                  
                    }
                  });
                //error=0 表示增加订单后总订单数大于10
   

        });
    </script>   
    </html>